package com.le.tester.book.effectivejava3rdchinese.secondReading.l47;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * createTime：2024-10-07 9:30
 * description：对于Stream中的.map操作，得到的是一个Stream<String[]></>
 * 接着.flatMap得到一个Stream<String></>
 * 跟for遍历操作元素是一样的
 */
public class Demo {
    public void f() {
        String[] words = new String[]{"Hello", "World"};
        List<String[]> l = Arrays.stream(words)
                .map(word -> word.split("l")).collect(Collectors.toList());
        String[] strings = l.get(0);

    }

    public static void main(String[] args) {
        new Demo().f();
    }
}
